/**
 * تنسيقات نظام قائمة الرغبات
 * Wishlist System CSS
 */

/* ===== زر المفضلة ===== */
[data-wishlist-btn] {
  position: relative;
  padding: 8px 12px;
  border: 2px solid #e84c3d;
  background: transparent;
  color: #e84c3d;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  touch-action: manipulation;
}

[data-wishlist-btn]:hover {
  background: rgba(232, 76, 61, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 76, 61, 0.2);
}

[data-wishlist-btn].active {
  background: #e84c3d;
  color: white;
  animation: heartBeat 0.3s ease;
}

[data-wishlist-btn]:active {
  transform: scale(0.95);
}

/* ===== Wishlist Badge (عدد المفضلة) ===== */
.wishlist-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

[data-wishlist-count] {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e84c3d;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(232, 76, 61, 0.3);
  animation: badgePulse 0.5s ease;
}

/* ===== Wishlist Notification ===== */
.wishlist-notification {
  position: fixed;
  bottom: 100px;
  right: 20px;
  background: white;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  z-index: 10000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  border-right: 4px solid #e84c3d;
}

.wishlist-notification.show {
  transform: translateX(0);
}

.wishlist-notification i {
  font-size: 18px;
}

.wishlist-notification.success {
  border-right-color: #27ae60;
  color: #27ae60;
}

.wishlist-notification.success i {
  color: #27ae60;
}

.wishlist-notification.info {
  border-right-color: #3498db;
  color: #3498db;
}

.wishlist-notification.info i {
  color: #3498db;
}

/* ===== Notification Action Button ===== */
.notification-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #e84c3d;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-left: 10px;
  white-space: nowrap;
}

.notification-action-btn:hover {
  background: #d9371b;
  transform: translateX(-2px);
}

.notification-action-btn:active {
  transform: scale(0.95);
}

.notification-action-btn i {
  font-size: 14px;
}

/* RTL Support for Notification */
[dir="rtl"] .notification-action-btn {
  margin-left: 0;
  margin-right: 10px;
  transform: scaleX(-1);
}

[dir="rtl"] .notification-action-btn i {
  transform: scaleX(-1);
}

/* Notification Container Structure */
.notification-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Wishlist Page ===== */
.wishlist-container {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wishlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 15px;
}

.wishlist-header h2 {
  font-size: 24px;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wishlist-count {
  background: #e84c3d;
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}

.wishlist-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wishlist-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.wishlist-btn-primary {
  background: #e84c3d;
  color: white;
}

.wishlist-btn-primary:hover {
  background: #c73a2b;
  box-shadow: 0 4px 12px rgba(232, 76, 61, 0.3);
}

.wishlist-btn-secondary {
  background: #f0f0f0;
  color: #0f172a;
  border: 1px solid #e0e0e0;
}

.wishlist-btn-secondary:hover {
  background: #e8e8e8;
  border-color: #d0d0d0;
}

/* ===== Wishlist Grid ===== */
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.wishlist-item {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.wishlist-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
  border-color: #e84c3d;
}

.wishlist-item-image {
  width: 100%;
  height: 180px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.wishlist-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.wishlist-item:hover .wishlist-item-image img {
  transform: scale(1.05);
}

.wishlist-item-info {
  padding: 12px;
}

.wishlist-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 8px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wishlist-item-price {
  font-size: 16px;
  font-weight: bold;
  color: #e84c3d;
  margin: 0 0 10px 0;
}

.wishlist-item-actions {
  display: flex;
  gap: 8px;
}

.wishlist-item-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.wishlist-item-btn-remove {
  background: #ffebee;
  color: #e84c3d;
  border: 1px solid #ffcdd2;
}

.wishlist-item-btn-remove:hover {
  background: #e84c3d;
  color: white;
}

.wishlist-item-btn-view {
  background: #e84c3d;
  color: white;
}

.wishlist-item-btn-view:hover {
  background: #c73a2b;
}

/* ===== Empty State ===== */
.wishlist-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.wishlist-empty i {
  font-size: 48px;
  color: #cbd5e1;
  margin-bottom: 15px;
}

.wishlist-empty h3 {
  font-size: 18px;
  margin: 0 0 10px 0;
  color: #0f172a;
}

.wishlist-empty p {
  font-size: 14px;
  margin: 0;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
  [data-wishlist-btn] {
    padding: 6px 10px;
    font-size: 12px;
  }

  .wishlist-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .wishlist-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .wishlist-actions {
    width: 100%;
  }

  .wishlist-btn {
    flex: 1;
    justify-content: center;
  }

  .wishlist-item-image {
    height: 140px;
  }

  .wishlist-notification {
    right: 10px;
    bottom: 60px;
    font-size: 12px;
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .wishlist-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .wishlist-item-name {
    font-size: 12px;
  }

  .wishlist-item-price {
    font-size: 14px;
  }
}

/* ===== Animations ===== */
@keyframes heartBeat {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes badgePulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== RTL Support ===== */
body.lang-ar .wishlist-notification {
  right: auto;
  left: 20px;
  border-right: none;
  border-left: 4px solid #e84c3d;
}

body.lang-ar .wishlist-btn,
body.lang-ar .wishlist-item-btn {
  flex-direction: row-reverse;
}

body.lang-ar .wishlist-item-name {
  text-align: right;
}

body.lang-ar .wishlist-empty {
  direction: rtl;
}
